<script>
  export let task;

  function toggle(e) {
    fetch('http://localhost:9000/tasks/${task.id}', {
      method: "PATCH",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify({ done: e.currentTarget.checked }),
    })
  }
</script>